<template>
	<div class="home">
		<Header></Header>
		<div class="container">
			<div>
				<Swiper :swiperList="swiperList"></Swiper>
				<Icons  :iconsList="iconsList"></Icons>
				<Localtion></Localtion>
				<Hot :hotList="hotList"></Hot>
				<Like :likeList="likeList"></Like>
				<Where :whereList="whereList"></Where>
				<Footer></Footer>
			</div>
		</div>

		<!-- <Bodyer></Bodyer> -->
		<img src="/api/data/img/time.gif" alt="" class="time">
	</div>
</template>
<script>
	import Header from './pages/header.vue'
	import Swiper from './pages/swiper'
	import Icons from './pages/icons'
	import Localtion from './pages/localtion'
	import Hot from './pages/hot'
	import Like from './pages/like'
	import Where from './pages/where'

	import Footer from './pages/footer'
	// import Bodyer from './pages/bodyer'
	 import { mapState } from 'vuex'

	export default{
		components:{
			Header,
			Footer,
			// Bodyer,
			Swiper,
			Icons,
			Localtion,
			Hot,
			Like,
			Where
		},
		data(){
			return{
				swiperList:[],
				iconsList:[],
				hotList:[],
				likeList:[],
				whereList:[],
				changeCity:"",
				data:[
					{
						"city":"西安",
						"swiperList":[
				        	{
				        		"id":"01",
				        		"url":"./static/img/01.jpg"
				        	},
				        	{
				        		"id":"02",
				        		"url":"./static/img/02.jpg"
				        	},
				        	{
				        		"id":"03",
				        		"url":"./static/img/03.jpg"
				        	},
				        	{
				        		"id":"04",
				        		"url":"./static/img/04.jpg"
				        	},
				        	{
				        		"id":"05",
				        		"url":"./static/img/05.jpg"
				        	}
			        	],
			        	"iconsList":[
				        	{
				        		"id":"01",
				        		"title":"景点门票",
				        		"url":"./static/img/icons/01.png"
				        	},
				        	{
				        		"id":"02",
				        		"title":"一日游",
				        		"url":"./static/img/icons/02.png"
				        	},
				        	{
				        		"id":"03",
				        		"title":"西安",
				        		"url":"./static/img/icons/03.png"
				        	},
				        	{
				        		"id":"04",
				        		"title":"西安",
				        		"url":"./static/img/icons/04.png"
				        	},
				        	{
				        		"id":"05",
				        		"title":"西安",
				        		"url":"./static/img/icons/05.png"
				        	},
				        	{
				        		"id":"06",
				        		"title":"西安",
				        		"url":"./static/img/icons/01.png"
				        	},
				        	{
				        		"id":"07",
				        		"title":"西安",
				        		"url":"./static/img/icons/01.png"
				        	},
				        	{
				        		"id":"08",
				        		"title":"西安",
				        		"url":"./static/img/icons/01.png"
				        	},
				        	{
				        		"id":"09",
				        		"title":"西安",
				        		"url":"./static/img/icons/02.png"
				        	},
				        	{
				        		"id":"10",
				        		"title":"西安",
				        		"url":"./static/img/icons/02.png"
				        	}
				        ],
				        "hotList":[
							{
								"id":"01",
								"url":"./static/img/hot/01.jpg",
								"title":"华清宫",
								"money":"108",
								"hot":"./static/img/hot/top1.png"
							},
							{
								"id":"02",
								"url":"./static/img/hot/02.jpg",
								"title":"华清宫",
								"money":"108",
								"hot":"./static/img/hot/top2.png"
							},
							{
								"id":"03",
								"url":"./static/img/hot/03.jpg",
								"title":"华清宫",
								"money":"108",
								"hot":"./static/img/hot/top3.png"
							},
							{
								"id":"04",
								"url":"./static/img/hot/05.jpg",
								"title":"华清宫",
								"money":"108"
							},
							{
								"id":"05",
								"url":"./static/img/hot/06.jpg",
								"title":"华清宫",
								"money":"108"
							},
							{
								"id":"06",
								"url":"./static/img/hot/07.jpg",
								"title":"华清宫",
								"money":"108"
							},
							{
								"id":"07",
								"url":"./static/img/hot/08.jpg",
								"title":"华清宫",
								"money":"108"
							},
							{
								"id":"08",
								"url":"./static/img/hot/09.jpg",
								"title":"华清宫",
								"money":"108"
							},
							{
								"id":"09",
								"url":"./static/img/hot/10.jpg",
								"title":"华清宫",
								"money":"108"
							}
			 			],
			 			"likeList":[
								{
									"url":"./static/img/like/01.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/02.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/03.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/04.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/05.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/06.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/07.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								}
							],
			 			"whereList":[
								{
									"url":"./static/img/where/01.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								},
								{
									"url":"./static/img/where/02.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								},
								{
									"url":"./static/img/where/03.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								},
								{
									"url":"./static/img/where/04.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								},
								{
									"url":"./static/img/where/05.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								}
							]
					},
					{
						"city":"北京",
						"swiperList":[
				        	{
				        		"id":"01",
				        		"url":"./static/img/01.jpg"
				        	},
				        	{
				        		"id":"02",
				        		"url":"./static/img/02.jpg"
				        	},
				        	{
				        		"id":"03",
				        		"url":"./static/img/03.jpg"
				        	},
				        	{
				        		"id":"04",
				        		"url":"./static/img/04.jpg"
				        	},
				        	{
				        		"id":"05",
				        		"url":"./static/img/05.jpg"
				        	}
			        	],
			        	"iconsList":[
				        	{
				        		"id":"01",
				        		"title":"景点门票",
				        		"url":"./static/img/icons/01.png"
				        	},
				        	{
				        		"id":"02",
				        		"title":"一日游",
				        		"url":"./static/img/icons/02.png"
				        	},
				        	{
				        		"id":"03",
				        		"title":"北京",
				        		"url":"./static/img/icons/03.png"
				        	},
				        	{
				        		"id":"04",
				        		"title":"北京",
				        		"url":"./static/img/icons/04.png"
				        	},
				        	{
				        		"id":"05",
				        		"title":"北京",
				        		"url":"./static/img/icons/05.png"
				        	},
				        	{
				        		"id":"06",
				        		"title":"北京",
				        		"url":"./static/img/icons/01.png"
				        	},
				        	{
				        		"id":"07",
				        		"title":"北京",
				        		"url":"./static/img/icons/01.png"
				        	},
				        	{
				        		"id":"08",
				        		"title":"北京",
				        		"url":"./static/img/icons/01.png"
				        	},
				        	{
				        		"id":"09",
				        		"title":"北京",
				        		"url":"./static/img/icons/02.png"
				        	},
				        	{
				        		"id":"10",
				        		"title":"北京",
				        		"url":"./static/img/icons/02.png"
				        	}
				        ],
				        "hotList":[
							{
								"id":"01",
								"url":"./static/img/hot/05.jpg",
								"title":"天安门",
								"money":"108",
								"hot":"./static/img/hot/top1.png"
							},
							{
								"id":"02",
								"url":"./static/img/hot/05.jpg",
								"title":"天安门",
								"money":"108",
								"hot":"./static/img/hot/top2.png"
							},
							{
								"id":"03",
								"url":"./static/img/hot/05.jpg",
								"title":"天安门",
								"money":"108",
								"hot":"./static/img/hot/top3.png"
							},
							{
								"id":"04",
								"url":"./static/img/hot/05.jpg",
								"title":"天安门",
								"money":"108"
							},
							{
								"id":"05",
								"url":"./static/img/hot/05.jpg",
								"title":"天安门",
								"money":"108"
							},
							{
								"id":"06",
								"url":"./static/img/hot/05.jpg",
								"title":"天安门",
								"money":"108"
							},
							{
								"id":"07",
								"url":"./static/img/hot/05.jpg",
								"title":"天安门",
								"money":"108"
							},
							{
								"id":"08",
								"url":"./static/img/hot/05.jpg",
								"title":"天安门",
								"money":"108"
							},
							{
								"id":"09",
								"url":"./static/img/hot/05.jpg",
								"title":"天安门",
								"money":"108"
							}
			 			],
			 			"likeList":[
								{
									"url":"./static/img/like/01.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/02.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/03.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/04.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/05.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/06.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								},
								{
									"url":"./static/img/like/07.jpg",
									"title":"秦岭野生动物园",
									"say":"10384",
									"money":"48",
									"place":"长安区",
									"mask":"可定明日"
								}
							],
			 			"whereList":[
								{
									"url":"./static/img/where/01.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								},
								{
									"url":"./static/img/where/02.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								},
								{
									"url":"./static/img/where/03.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								},
								{
									"url":"./static/img/where/04.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								},
								{
									"url":"./static/img/where/05.jpg",
									"title":"西安泡汤圣地",
									"info":"解压之地，放松自己，来一段轻松的旅程。"
								}
							]
					}
				]
			}
		},
		computed:{
              ...mapState(['city'])
        },
		methods:{
			GetHttp(){
				// this.$http.get("/api/data/data.json").then((response)=>{
				// this.$http.get("./../../../data/data.json").then((response)=>{
					let data = this.data
			        data.forEach((item,index)=>{
			        	if(item.city ==this.city){
					        this.swiperList =item.swiperList
					        this.iconsList =item.iconsList
					        this.hotList =item.hotList
					        this.likeList =item.likeList
					        this.whereList =item.whereList
			        	}
			        })
		        // })
			}
		},
	    mounted(){
	    	this.GetHttp()
	    	this.changeCity =this.city;
	    },
	    activated(){
	    	if(this.changeCity !=this.city){
	    		this.GetHttp()
	    		this.changeCity =this.city;
	    	}
	    }
	}
</script>
<style>
      .time{
      	display: block;
      	width: 100%;
      }
</style>